<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
        <tr>
            <td style="width:100%;">
            	<sec:authorize url='/per_ana_group_export.do'>
            	<a class="mini-button" iconCls="icon-download" onclick="exportAllData()">导出全部</a>
            	</sec:authorize>
            	<span style="color: #f00;">统计所有话务组的业绩情况，默认总销售额倒序排列</span>
            </td>
             <td style="white-space:nowrap;">
                                          开始时间：<input name="start_time" format="yyyy-MM-dd HH:mm:ss" id="start_time" class="mini-datepicker" showTime="true" style="width: 160px" showClearButton="true" allowInput="false"/>
                                           结束时间：<input name="end_time" id="end_time" emptyText="请选择..." format="yyyy-MM-dd HH:mm:ss" class="mini-datepicker"  showTime="true" showClearButton="true" style="width: 160px" allowInput="false"/>   
                <a class="mini-button" iconCls="icon-search" onclick="search()">查询</a>
            </td>
        </tr>
    </table>        
</div>
<div class="mini-fit" >
	<div id="datagrid0921" class="mini-datagrid" idField="id" pageSize="20" multiSelect="true"
		url="per_ana_group_view.do" style="width:100%;height: 100%">
		<div property="columns">
			<div type="indexcolumn">公司排名</div>
			<div field="groupName" width="12%" headerAlign="center" align="center">组</div>
			<div field="userCount" width="12%" headerAlign="center" align="center">人数</div>
			<div field="incomingCount" width="12%" headerAlign="center" align="center">总接线数</div>
			<div field="outgoingCount" width="12%" headerAlign="center" align="center">总呼出量</div>
			<div field="ordersCount" width="12%" headerAlign="center" align="center" allowSort="true">总订单数</div>
			<div field="tTMoney" width="10%" headerAlign="center" align="center" allowSort="true">总销售额</div>
			<div field="avgMoney" width="10%" headerAlign="center" align="center" allowSort="true">人均金额</div>
			<div field="tProductQuantity" width="10%" headerAlign="center" align="center" allowSort="true">产品数量</div>
		</div>
	</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid0921");
var startTime = mini.get("start_time");
var endTime = mini.get("end_time");
var myDate = new Date();
var sm = myDate.toLocaleDateString();
startTime.setValue(sm);

grid.load({startTime: startTime.getFormValue()});
grid.sortBy("tTMoney", "desc");

function search() {
	grid.load({startTime: startTime.getFormValue(), endTime: endTime.getFormValue()});
}

//导出全部
function exportAllData(){
	var startTime = mini.getbyName("start_time").getFormValue();
	var endTime = mini.getbyName("end_time").getFormValue();
	location.href="per_ana_group_export.do?stime="+startTime+"&etime="+endTime; 
}
</script>
</body>
</html>